package com.iplay.thezen.proxy;

/**
 * @author dangwu
 * @since 2021/9/3 4:27 下午
 */
public class Proxy implements Subject{
    private final Subject subject;
    public Proxy(Subject subject){
        this.subject = subject;
    }
    @Override
    public void request() {
        //执行预处理逻辑
        this.before();

        subject.request();

        //执行善后逻辑
        this.after();
    }

    private void before(){
        System.out.println("执行预处理逻辑...");
    }

    private void after(){
        System.out.println("执行善后逻辑...");
    }
}
